import request from '@/config/axios'
import { AdverData } from '@/api/lunbotu/types'

//查看轮播图
export const getViewApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/SyOperationController/selCarouselPictures', params })
}

//根据ID查询
export const getViewApi1 = (carousel_id: string): Promise<IResponse> => {
  return request.get({
    url: '/api/SyOperationController/selCarousel',
    params: { carousel_id }
  })
}

//修改轮播图
export const saveTableApi = (data: Partial<AdverData>): Promise<IResponse> => {
  return request.post({ url: '/api/SyOperationController/updCarousel', data })
}

//添加轮播图
export const addAdverApi = (data: Partial<AdverData>): Promise<IResponse> => {
  return request.post({ url: '/api/SyOperationController/addCarousel', data })
}

//删除轮播图
export const delAdverApi = (carousel_id: number): Promise<IResponse> => {
  return request.get({ url: '/api/SyOperationController/DeleteCarousel', params: { carousel_id } })
}
